<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments::header(~{::title})">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <meta charset="UTF-8">
    <title>定春的博客</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <link rel="stylesheet" href="../static/css/animate.css">
</head>
<style>

    .ctitle {
        width: 100%;/*设置总宽度*/
        color: #999aaa;
        white-space: nowrap;/*强调文本在一行内显示*/
        overflow: hidden;/*溢出内容为隐藏*/
        text-overflow:ellipsis;/*溢出文本显示省略号*/
    }
    .ctitle:hover {
        color: red;
    }
    .htitle{
        color: #555666;
    }
    .htitle:hover{
        color: red;
    }

</style>
<body>
<!--导航栏-->
<nav th:replace="_fragments::menu(1)" class="ui  inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item ">JavaStudy</h2>
            <a class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a class="m-item item m-mobile-hide"><i class="info icon"></i>我的</a>
            <div class="right m-item item m-mobile-hide">
                <div class="ui icon inverted transparent input  m-margin-tb-tiny">
                    <input type="text" placeholder="搜索">
                    <i class="search link icon"></i>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<!--中间部分-->
<div class="m-container m-padded-tb-big">
    <div class="ui container">
        <div class="ui stackable grid">
            <!--left bloglist-->
            <div class="eleven wide column">
                <!--header-->
                <div class="ui top attached segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">博客</h3>
                        </div>
                        <div class="right aligned column">
                            共 <h2 class="ui orange header m-inline-block" th:text="${page.totalElements}">14</h2> 篇
                        </div>
                    </div>
                </div>

                <!--content-->
                <div class="ui attached  segment">

                    <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                        <div class="ui middle aligned mobile reversed stackable grid">
                            <div class="eleven wide column">
                                <h3 class="ui header">
                                    <!--                                    <a  th:href="@{/blog/{id}(id=${blog.id})}" target="_blank" href="#" class="m-black" th:text="${blog.title}">标题啥大事的机会手机卡哈</a>-->
                                    <a th:href="@{/blog/{id}(id=${blog.id})}" href="#" class="m-black"
                                       th:text="${blog.title}">标题啥大事的机会手机卡哈</a>
                                </h3>
                                <p class="m-text" th:text="|${blog.description}......|">
                                    正确做好任何一件事情的前提是清晰、正确的理解目标。而事实是，我们很多人很多时候根本没有对目标正确的定义，甚至根本从来就没有想过，只是大家都那么做而已…..
                                </p>
                                <div class="ui middle aligned grid">
                                    <div class="eleven wide column">
                                        <div class="ui mini horizontal link list">
                                            <div class="item">
                                                <img th:src="@{${blog.user.avatar}}"
                                                     class="ui avatar image m-margin-bottom-tiny"
                                                     src="https://picsum.photos/id/1005/100/100" alt="avatar">
                                                <div class="content"><a th:text="${blog.user.nickname}" href="#"
                                                                        class="header m-margin-bottom-tiny">定春</a></div>
                                            </div>
                                            <div class="item">
                                                <i class="calendar icon m-margin-bottom-mini"></i><span
                                                    th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-08-15</span>
                                            </div>
                                            <div class="item">
                                                <i class="eye icon m-margin-bottom-mini"></i><span
                                                    th:text="${blog.views}">81203</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="right aligned five wide column">
                                        <a href="#" target="_blank" th:text="${blog.type.name}"
                                           class="ui teal basic  label">认知升级</a>
                                    </div>
                                </div>
                            </div>
                            <div class="five wide column">
                                <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                    <img th:src="@{${blog.firstPicture}}" class="ui rounded image"
                                         src="https://picsum.photos/id/1005/800/450" alt="">
                                </a>
                            </div>
                        </div>
                    </div>

                </div>

                <!--footer分页-->
                <div class="ui attached segment" th:if="${page.totalPages}>1">
                    <div class="ui middle aligned three column grid">
                        <div class="column">
                            <a href="#" th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}"
                               class="ui mini teal basic button">上一页</a>
                        </div>
                        <div class="column">
                            <div class="ui  borderless pagination menu">
                                <a class="item" th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}">
                                    <i class="left arrow icon"></i>
                                </a>
                                <a th:each="pageNum:${#numbers.sequence(1, page.totalPages )}"
                                   class="item" th:classappend="${pageNum==(page.number+1)} ? 'active'"
                                   th:href="@{/(page=${pageNum}-1)}" th:text="${pageNum}">1</a>
                                <a class="item" th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}">
                                    <i class="icon right arrow"></i>
                                </a>
                            </div>
                        </div>
                        <div class="right aligned column">
                            <a href="#" th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}"
                               class="ui mini teal basic button">下一页</a>
                        </div>
                    </div>
                </div>

            </div>

            <!--right topcards-->
            <div class="five wide column">

                <!--分类card-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column" style="font-weight: bolder">
                                <i class="idea icon"></i>分类
                            </div>
                            <div class="right aligned column">
                                <a th:href="@{/types?id=-1}" href="" target="_blank">更多 <i
                                        class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu">
                            <a th:href="@{'/types?id='+${type.id}}" href="#" class="item" th:each="type : ${types}">
                                <span th:text="${type.name}">学习日志</span>
                                <div th:text="${#arrays.length(type.blogs)}+'篇'"
                                     class="ui teal basic left pointing label">13
                                </div>
                            </a>
                            <!--/*-->
                            <a href="#" class="item">
                                学习日志
                                <div class="ui teal basic left pointing label">13</div>
                            </a>
                            <a href="#" class="item">
                                学习日志
                                <div class="ui teal basic left pointing label">13</div>
                            </a>
                            <!--*/-->
                        </div>
                    </div>
                </div>

                <!--评论card-->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column" style="font-weight: bolder">
                                <i class="comment alternate outline icon"></i> 最新评论
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu">
                            <div class="cparent item" th:each="comment : ${comments}">
                                <div class="ctitle" style="height: 20px">
                                    <a th:href="@{'/blog/'+${comment.blog.id}+'#comment-container'}"
                                       th:text="${comment.blog.title}" class="ctitle">文章标题</a>
                                </div>
                                <div>
                                    <span th:text="${comment.nickname}" class="cname">作者</span>: <span
                                        th:text="${comment.content}" class="ccontent">评论内容</span>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>

                <!--标签card-->
                <div class="ui segments  m-margin-top-large">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column" style="font-weight: bolder">
                                <i class="tags icon"></i> 标签
                            </div>
                            <div class="right aligned column">
                                <a th:href="@{/tags/-1}" href="" target="_blank">更多 <i
                                        class="angle double right icon"></i></a>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <a th:href="@{/tags/{id}(id=${tag.id})}" th:each="tag:${tags}"
                           href="#" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny">
                            <span th:text="${tag.name}">方法论</span>
                            <div class="detail" th:text="${#arrays.length(tag.blogs)}">23</div>
                        </a>
                        <!--/*-->
                        <a href="#" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny">
                            Redis
                            <div class="detail">23</div>
                        </a>
                        <a href="#" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny">
                            方法论
                            <div class="detail">23</div>
                        </a>
                        <!--*/-->

                    </div>
                </div>

                <!--最新推荐card-->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment" style="font-weight: bolder">
                        <i class="bookmark icon"></i>最新推荐
                    </div>
                    <div class="ui segment" th:each="blog:${recommendBlogs}">
                        <i class="fire red icon"></i>
                        <!--class="m-text-thin m-black"-->
                        <a th:href="@{/blog/{id}(id=${blog.id})}" href="#" target="_blank"
                           th:text="${blog.title}" class="htitle" >Spring Boot入门</a>
                        <div style="display: inline-block; color: #555666">
                            <i class="eye icon m-margin-bottom-mini"></i>
                            <span style="font-size: 0.5em;" th:text="${blog.views}">81203</span>
                        </div>
                    </div>
                    <!--/*-->
                    <div class="ui segment">
                        <i class="fire red icon"></i><a href="#" target="_blank" class="m-text-thin m-black">Spring
                        Boot入门</a>
                    </div>
                    <div class="ui segment">
                        <i class="fire red icon"></i><a href="#" target="_blank" class="m-text-thin m-black">Spring
                        Boot入门</a>
                    </div>
                    <!--*/-->
                </div>

                <!--二维码-->
                <h4 class="ui horizontal divider header m-margin-top-large">我是定春</h4>
                <div class="ui centered card" style="width: 11em">
                    <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" alt=""
                         class="ui rounded image">
                </div>


            </div>
        </div>

    </div>

</div>

<br>
<br>

<!--底部 用抽取的组件替换-->
<footer th:replace="_fragments::footer" class="ui inverted vertical segment m-padded-tb-massive">
    <div class="ui center aligned  container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" class="ui rounded image"
                             alt="" style="width: 110px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">最新博客</h4>
                <div class="ui inverted link list m-text-thin m-text-spaced m-opacity-mini">
                    <a href="#" class="item">用户故事 User story</a>
                    <a href="#" class="item">用户故事 User story</a>
                    <a href="#" class="item">用户故事 User story</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                <div class="ui inverted link list m-text-thin m-text-spaced m-opacity-mini">
                    <a href="#" class="item m-text-lined">Email: xingzq.dc@foxmail.com</a>
                    <a href="#" class="item">QQ: 1961329303</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">定春</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">
                    我是定春，欢迎来到我的博客，这是我第一个线上项目，我会在此分享个人所学的Java知识或者一些生活琐事</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2021 - 2022 Dingchun Designed by Dingchun</p>
    </div>
</footer>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>

<script>
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    })


    $('#newblog-container').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");
</script>

</body>
</html>